4 // Created by raf on Sun Jan 28 2001.
5 // Based on SpeechUtilities framework by Raphael Sebbe.
6 // Revised by Evan Schoenberg on Tue Sep 30 2003.
7 // Optimized and expanded by Evan Schoenberg.
9 #import <Foundation/Foundation.h>
10 #import <Carbon/Carbon.h>
14 * @brief Cocoa wrapper for the Carbon Speech Synthesis Manager
16 @interface SUSpeaker
: NSObject
18 SpeechChannel _speechChannel
;
21 NSData
*currentSpeechMacRomanData
;
24 unsigned int _reserved1
;
25 unsigned int _reserved2
;
28 + (NSArray
*)voiceNames
;
29 //+(NSString*) defaultVoiceName;
32 - (void) setPitch
:(float)pitch
;
34 //rate is in words per minute.
35 - (void) setRate
:(float)rate
;
38 -(void)setVolume
:(float)vol
;
40 //voice is an index into +voiceNames. pass -1 for the default voice.
41 - (void) setVoiceUsingIndex
:(int)index
;
43 - (void) speakText
:(NSString
*)text
;
44 - (void) stopSpeaking
;
46 - (void) resetToDefaults
;
48 //e.g., for Bad News: 'The light you see at the end of the tunnel is the headlamp of a fast approaching train.' (remember that Bad News is a singing voice...)
49 - (NSString
*)demoTextForVoiceAtIndex
:(int)voiceIndex
;
51 -(void) setDelegate
:(id
)delegate
;
56 @interface
NSObject (SUSpeakerDelegate
)
57 -(void) didFinishSpeaking
:(SUSpeaker
*)speaker
;
58 -(void) willSpeakWord
:(SUSpeaker
*)speaker at
:(int)where length
:(int)length
;